import { z } from 'zod';
const amplitudeConfigInterfaceSchema = z.object({
    apiKey: z.string(),
});
const clearbitConfigInterfaceSchema = z.object({
    publicApiKey: z.string(),
});
const fathomConfigInterfaceSchema = z.object({
    siteId: z.string(),
});
const googleAnalyticsConfigInterfaceSchema = z.object({
    measurementId: z.string().startsWith('G', 'Must start with G'),
});
const googleTagManagerConfigInterfaceSchema = z.object({
    tagId: z.string().startsWith('G', 'Must start with G'),
});
const hotjarConfigInterfaceSchema = z.object({
    hjid: z.string(),
    hjsv: z.string(),
});
const koalaConfigInterfaceSchema = z.object({
    publicApiKey: z.string().min(2),
});
const logrocketConfigInterfaceSchema = z.object({
    appId: z.string(),
});
const mixpanelConfigInterfaceSchema = z.object({
    projectToken: z.string(),
});
const pirschConfigInterfaceSchema = z.object({
    id: z.string(),
});
const postHogConfigInterfaceSchema = z.object({
    apiKey: z.string().startsWith('phc_', 'Must start with phc_'),
    apiHost: z.string().url('Must be a valid URL').optional(),
});
const plausibleConfigInterfaceSchema = z.object({
    domain: z
        .string()
        .refine((domain) => !domain.startsWith('http://') && !domain.startsWith('https://'), 'Must not start with http:// or https://'),
});
export const analyticsSchema = z
    .object({
    amplitude: amplitudeConfigInterfaceSchema.optional(),
    clearbit: clearbitConfigInterfaceSchema.optional(),
    fathom: fathomConfigInterfaceSchema.optional(),
    ga4: googleAnalyticsConfigInterfaceSchema.optional(),
    gtm: googleTagManagerConfigInterfaceSchema.optional(),
    hotjar: hotjarConfigInterfaceSchema.optional(),
    koala: koalaConfigInterfaceSchema.optional(),
    logrocket: logrocketConfigInterfaceSchema.optional(),
    mixpanel: mixpanelConfigInterfaceSchema.optional(),
    pirsch: pirschConfigInterfaceSchema.optional(),
    posthog: postHogConfigInterfaceSchema.optional(),
    plausible: plausibleConfigInterfaceSchema.optional(),
})
    .strict('Mintlify only supports analytics integrations from: amplitude, clearbit, fathom, ga4, gtm, hotjar, koala, logrocket, mixpanel, pirsch, posthog and plausible.');
